package net.exoweb.animate.objects
{
    import net.exoweb.animate.objects.DisplayShape;

    public class Circle extends DisplayShape
    {
        private var _thickness:Number;
        private var _thickColor:uint;
        private var _radius:Number;
        private var _centerAlpha:Number;

        public function Circle(thickness:Number=0, thickColor:uint=0x000000, radius:Number=1, color:uint=0xFFFFFF, alpha:Number=1, bm:String="normal")
        {
            super(color, bm);
            _thickness = thickness;
            _thickColor = thickColor;
            _radius = radius;
            _centerAlpha = alpha;
            display();
        }

        public function set thickness(v:Number):void
        {
            _thickness = v;
            display();
        }

        public function get thickness():Number
        {
            return _thickness;
        }

        public function set thickColor(v:uint):void
        {
            _thickColor = v;
            display();
        }

        public function get thickColor():uint
        {
            return _thickColor;
        }

        public function set radius(v:Number):void
        {
            _radius = v;
            display();
        }

        public function get radius():Number
        {
            return _radius;
        }

        public function set centerAlpha(v:Number):void
        {
            _centerAlpha = v;
            display();
        }

        public function get centerAlpha():Number
        {
            return _centerAlpha;
        }

        override public function display():void
        {
            graphics.clear();
            if(_thickness != 0)
            {
                graphics.lineStyle(_thickness, _thickColor);
            }
            graphics.beginFill(_color, _centerAlpha);
            graphics.drawCircle(0, 0, _radius);
            graphics.endFill();
        }
    }
}
